package com.yule.vo;

import org.apache.commons.lang.StringUtils;

public enum LogModuleVo {

	empty(null, ""),
	/** 用户 */
	system_user("system_user", "用户"),
	/** 角色 */
	system_role("system_role", "角色"),
	/** 权限 */
	system_auth("system_auth", "权限"),
	/** 消息 */
	remind_message("remind_message", "消息"),
	/** 项目文件变更审批 */
	project_file("project_file", "项目文件变更审批"),
	/** 项目 */
	project("project", "项目"),
	/** 系统DFMEA */
	dfmea_product("dfmea_product", "系统DFMEA"),
	/** 子系统DFMEA */
	dfmea_half("dfmea_half", "子系统DFMEA"),
	/** 零部件DFMEA */
	dfmea_material("dfmea_material", "零部件DFMEA"),
	/** 系统PFMEA */
	pfmea_product("pfmea_product", "系统PFMEA"),
	/** 子系统PFMEA */
	pfmea_half("pfmea_half", "子系统PFMEA");

	private String key;
	private String value;

	private LogModuleVo(String key, String value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}

	public static final LogModuleVo getInstance(String key) {
		for (LogModuleVo vo : values()) {
			if (StringUtils.isEmpty(key)) {
				return empty;
			} else if (key.equals(vo.getKey())) {
				return vo;
			}
		}
		throw new RuntimeException();
	}

}
